<template>
    <div class="control">

        <!--S控制按钮-->
        <div id="controls">

            <div class="controls-child" @click="showPoster">
                <svg><use xlink:href='#icon-erweima'></use></svg>
                <p>红包码</p>
            </div>

            <div
                    class="controls-child"
                    v-if="show_red_form"
            >
                <router-link class="a" :to="$route.path+'/form-list/'+red.id">
                    <svg><use xlink:href='#icon-biaodan1'></use></svg>
                    <p>表单</p>
                </router-link>
            </div>

        </div>
        <!--E控制按钮-->

    </div>
</template>

<script>
export default {
    name: "red-qrcode",
    props: {
      red: {
          type: Object
      }
    },
    computed: {
      show_red_form () {
          return this.red.red_form === 1 && this.red.owner
      }
    },
    methods: {
        showPoster() {
            this.$createPoster({
                red_id: parseInt(this.red.id),
                is_show: new Date().getTime()
            },true)
        }
    }
}
</script>

<style scoped lang="less" src="../../../../components/control/control.less"></style>
